package com.cq.hd.system.controller;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.entity.hf.*;
import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.system.api.HfApi;
import com.cq.hd.system.api.dto.HfVerifyDto;
import com.cq.hd.system.biz.HfBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class HfController implements HfApi {

    @Autowired
    private HfBiz hfBiz;

    @Override
    public Result<Boolean> verify(@RequestBody HfVerifyDto hfVerifyDto) {
        return ResultGenerator.success(hfBiz.verify(hfVerifyDto));
    }

    @Override
    public Result<JSONObject> basicDataQuery(String applyNo, String huiFuId) {
        return ResultGenerator.success(hfBiz.basicDataQuery(applyNo, huiFuId));
    }

    @Override
    public Result<String> imgUpload(MultipartFile file, String type) {
        return ResultGenerator.success(hfBiz.imgUpload(file, type));
    }

    @Override
    public Result<HfBusinessEnterApplyResult> merchantEnt(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantEnt(hfBusinessEnterApply));
    }

    @Override
    public Result<HfBusinessEnterApplyResult> merchantEntUpdate(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantEntUpdate(hfBusinessEnterApply));
    }

    @Override
    public Result<HfBusinessEnterOpenResult> merchantOpen(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantOpen(hfBusinessEnterApply));
    }

    @Override
    public Result<HfBusinessEnterOpenResult> merchantSettleConfig(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantSettleConfig(hfBusinessEnterApply));
    }

    @Override
    public Result<HfBusinessEnterApplyResult> merchantEntIndv(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantEntIndv(hfBusinessEnterApply));
    }

    @Override
    public Result<JSONObject> jsPay(@RequestBody HfJsPay hfJsPay) {
        return ResultGenerator.success(hfBiz.jsPay(hfJsPay));
    }

    @Override
    public Result<JSONObject> merchantBasicDataQuery(String hfMerchantNo) {
        return ResultGenerator.success(hfBiz.merchantBasicDataQuery(hfMerchantNo));
    }

    @Override
    public Result<JSONObject> wxBusinessRealQuery(String hfMerchantNo) {
        return ResultGenerator.success(hfBiz.wxBusinessRealQuery(hfMerchantNo));
    }

    @Override
    public Result<JSONObject> wxBusinessConfig(String hfMerchantNo) {
        return ResultGenerator.success(hfBiz.wxBusinessConfig(hfMerchantNo));
    }

    @Override
    public Result<JSONObject> preOrder(@RequestBody HfJsPay hfJsPay) {
        return ResultGenerator.success(hfBiz.preOrder(hfJsPay));
    }

    @Override
    public Result<JSONObject> tradeQuery(@RequestBody HfTradeQuery hfTradeQuery) {
        return ResultGenerator.success(hfBiz.tradeQuery(hfTradeQuery));
    }

    @Override
    public Result<JSONObject> tradeRefund(@RequestBody HfTradeRefund hfTradeRefund) {
        return ResultGenerator.success(hfBiz.tradeRefund(hfTradeRefund));
    }

    @Override
    public Result<JSONObject> tradeRefundQuery(@RequestBody HfTradeRefundQuery hfTradeRefundQuery) {
        return ResultGenerator.success(hfBiz.tradeRefundQuery(hfTradeRefundQuery));
    }

    @Override
    public Result<JSONObject> agentUserInvite(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply) {
        return ResultGenerator.success(hfBiz.agentUserInvite(hfAgentUserEnterApply));
    }

    @Override
    public Result<JSONObject> agentUserOpen(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply) {
        return ResultGenerator.success(hfBiz.agentUserOpen(hfAgentUserEnterApply));
    }

    @Override
    public Result<JSONObject> agentUserQuery(String hfId) {
        return ResultGenerator.success(hfBiz.agentUserQuery(hfId));
    }

    @Override
    public Result<JSONObject> merchantSignQuery() {
        return ResultGenerator.success(hfBiz.merchantSignQuery());
    }

    @Override
    public Result<JSONObject> agentSignCreate(@RequestBody HfAgentUserSignCreate hfAgentUserSignCreate) {
        return ResultGenerator.success(hfBiz.agentSignCreate(hfAgentUserSignCreate));
    }

    @Override
    public Result<JSONObject> agentSignQuery(String contractId) {
        return ResultGenerator.success(hfBiz.agentSignQuery(contractId));
    }

    @Override
    public Result<JSONObject> tradeAccountAmtPay(@RequestBody HfTradeAccountPay hfTradeAccountPay) {
        return ResultGenerator.success(hfBiz.tradeAccountAmtPay(hfTradeAccountPay));
    }

    @Override
    public Result<JSONObject> tradeAccountAmtQuery(@RequestBody HfTradeAccountPay hfTradeAccountPay) {
        return ResultGenerator.success(hfBiz.tradeAccountAmtQuery(hfTradeAccountPay));
    }

    @Override
    public Result<JSONObject> tradeMarketTransferPay(@RequestBody HfTradeMarketPay hfTradeMarketPay) {
        return ResultGenerator.success(hfBiz.tradeMarketTransferPay(hfTradeMarketPay));
    }

    @Override
    public Result<JSONObject> tradeMarketTransferQuery(@RequestBody HfTradeMarketPay hfTradeMarketPay) {
        return ResultGenerator.success(hfBiz.tradeMarketTransferQuery(hfTradeMarketPay));
    }

    @Override
    public Result<JSONObject> settlement(@RequestBody HfSettlement hfSettlement) {
        return ResultGenerator.success(hfBiz.settlement(hfSettlement));
    }

    @Override
    public Result<JSONObject> settlementQuery(@RequestBody HfSettlement hfSettlement) {
        return ResultGenerator.success(hfBiz.settlementQuery(hfSettlement));
    }

    @Override
    public Result<JSONObject> hycInvCategoryQuery(String minorAgentId) {
        return ResultGenerator.success(hfBiz.hycInvCategoryQuery(minorAgentId));
    }

    @Override
    public Result<HfInvApply> hycInvApply(@RequestBody HfInvApply hfInvApply) {
        return ResultGenerator.success(hfBiz.hycInvApply(hfInvApply));
    }

    @Override
    public Result<JSONObject> hycInvQuery(@RequestBody HfInvApply hfInvApply) {
        return ResultGenerator.success(hfBiz.hycInvQuery(hfInvApply));
    }

    @Override
    public Result<JSONObject> bankPay(@RequestBody HfBankPay hfBankPay) {
        return ResultGenerator.success(hfBiz.bankPay(hfBankPay));
    }

    @Override
    public Result<JSONObject> bankPayQuery(@RequestBody HfTradeQuery hfTradeQuery) {
        return ResultGenerator.success(hfBiz.bankPayQuery(hfTradeQuery));
    }

    @Override
    public Result<JSONObject> agentUserModify(@RequestBody HfAgentUserEnterApply hfAgentUserEnterApply) {
        return ResultGenerator.success(hfBiz.agentUserModify(hfAgentUserEnterApply));
    }

    @Override
    public Result<JSONObject> acctBalanceQuery(String hfId) {
        return ResultGenerator.success(hfBiz.acctBalanceQuery(hfId));
    }

    @Override
    public Result<JSONObject> userBasicDataQuery(String hfId) {
        return ResultGenerator.success(hfBiz.userBasicDataQuery(hfId));
    }

    @Override
    public Result<JSONObject> merchantSettleModify(@RequestBody HfBusinessEnterApply hfBusinessEnterApply) {
        return ResultGenerator.success(hfBiz.merchantSettleModify(hfBusinessEnterApply));
    }
}
